<?php

namespace Home\Controller;

use Think\Controller;

class WelcomeController extends Controller {

    public function index() {
        $model = M('welcome');
        $condition['PublicCodeID'] = 1;
        $form = $model->where($condition)->find();
        $this->assign('vo', $form);
        $this->display("basic");
    }

    public function Handle() {
        $message = I('message', '', "htmlspecialchars");
        $ID=I('ID','','htmlspecialchars');
        $model = M('welcome');
        $data['Content'] = $message;
        $result = $model->where('id='.$ID)->save($data);
        $this->ajaxReturn('y','EVAL');
    }
}
